﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPage2.master" AutoEventWireup="true" CodeFile="Admin_ThemTaiKhoan.aspx.cs" Inherits="Admin_Admin_ThemTaiKhoan" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript" language="javascript">

function checkCMNDTonTai() {
    var text = document.getElementById("<%=txtCMND.ClientID %>").value;
    if(isNaN(text) == true)
    {
        alert('Phải nhập vào số lượng!');
        return false;
    }    
    
    xmlhttp = GetXmlHttpObject();
    if (xmlhttp==null)
    {
        alert ("Your browser does not support XML HTTP Request");
        return;
    }
    var serverURL="Admin_XuLyAjaxKiemTraCMNDTonTai.aspx";
    serverURL=serverURL+"?q="+ text;
    serverURL=serverURL+"&sid="+Math.random();
    xmlhttp.onreadystatechange=HandleResponseFromServer3;
    xmlhttp.open("GET",serverURL,true);
    xmlhttp.send(null);  
}



</script>
<center>
<h2>THÊM TÀI KHOẢN</h2>
</center>
<table align="left">
            <tr>
                <td align="right" class="style2">
                    Vai trò:
                </td>
                <td align="left" class="style3">
                    <asp:DropDownList ID="comboboxVaiTro" runat="server"                         
                        Width="187px" DataSourceID="SqlDataSource1" DataTextField="TenVaiTro" 
                        DataValueField="Id">
                        <asp:ListItem Value="1">Admin</asp:ListItem>
                        <asp:ListItem Value="2">Khách hàng thân thiết</asp:ListItem>
                        <asp:ListItem Value="3">Khách hàng đại chúng</asp:ListItem>
                    </asp:DropDownList>
                </td>
                
            </tr>
            
            
            <tr>
                <td align="right" class="style2">
                    CMND:
                </td>
                <td align="left" class="style3">
                    <asp:TextBox ID="txtCMND" runat="server" Width="116px"></asp:TextBox>
                
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="txtCMND" ErrorMessage="*"></asp:RequiredFieldValidator>
                    <asp:RangeValidator ControlToValidate="txtCMND" ID="cmndValidate" runat="server" ErrorMessage="Giá trị không hợp lệ" MinimumValue="0" MaximumValue="9999999999"></asp:RangeValidator>    
                </td>
            </tr>
            <tr>
                <td align="right" class="style2">
                    Password:</td>
                <td align="left" class="style3">
                    <asp:TextBox ID="txtPassword" runat="server" Width="142px" TextMode="Password"></asp:TextBox>
                
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ControlToValidate="txtPassword" 
                        ErrorMessage="*"></asp:RequiredFieldValidator>
                </td>
            </tr>
            
            <tr>
                <td align="right" class="style2">
                    Nhập lại pasword:
                </td>
                <td align="left" class="style3">
                    <asp:TextBox ID="txtNhapLaiPass" runat="server" Width="140px" 
                        TextMode="Password"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                        ControlToValidate="txtNhapLaiPass" ErrorMessage="*"></asp:RequiredFieldValidator>
                    <asp:CompareValidator ID="CompareValidator1" runat="server" 
                        ControlToCompare="txtPassword" ControlToValidate="txtNhapLaiPass" 
                        ErrorMessage="Password nhập lại không khớp"></asp:CompareValidator>
                </td>
                
            </tr>
            
            <tr>
                <td align="right" class="style2">
                    Họ và tên:</td>
                <td align="left" class="style3">
                    <asp:TextBox ID="txtHoTen" runat="server" Width="190px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                        ControlToValidate="txtHoTen" ErrorMessage="*"></asp:RequiredFieldValidator>
                </td>
                                
            </tr>
            
            
                        
            <tr>
                <td align="right" class="style2">
                    Hình Ảnh:
                </td>
                <td align="left" class="style3">
                    <asp:FileUpload ID="fileuploadHinhAnh" runat="server" Width="267px" />
                </td>
                
            </tr>
            
            <tr>
                <td align="right" class="style2">
                    Email:
                </td>
                <td align="left" class="style3">
                    <asp:TextBox ID="txtEmail" runat="server" Width="261px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="txtEmail">*</asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                        ControlToValidate="txtEmail" Font-Size="8pt"  ErrorMessage="Email không hợp lệ" 
                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                </td>                
            </tr>
            
             <tr>
                <td align="right" class="style2">
                    Điện thoại:
                </td>
                <td align="left" class="style3">
                    <asp:TextBox ID="txtDienThoai" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="txtDienThoai">*</asp:RequiredFieldValidator>
                    
                    <asp:RangeValidator ControlToValidate="txtDienThoai" ID="RangeValidator1" runat="server" ErrorMessage="Giá trị không hợp lệ" MinimumValue="0" MaximumValue="99999999999999"></asp:RangeValidator>    
                </td>
                
            </tr>
            
            <tr>
                <td align="right" class="style2">
                    Địa chỉ:
                </td>
                <td align="left" class="style3">
                    <asp:TextBox ID="txtDiaChi" runat="server" Height="67px" TextMode="MultiLine" 
                        Width="270px"></asp:TextBox>
                </td>
                
            </tr>           
            
            <tr>
                <td>
                </td>
                <td>
                    <asp:CheckBox ID="chkGuiMail" runat="server" 
                        Text="Gửi email thông tin sản phẩm yêu thích" />
                </td>
            </tr>            
          
            
            <tr align="right">
                <td class="style3" align="center" colspan="3">
                    <asp:Button ID="btnThem" runat="server" onclick="btnThem_Click" Text="Thêm" 
                        Width="74px" />
                </td>
                
            </tr>
            
            
        </table>

    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:SMOConnectionString %>" 
        SelectCommand="SELECT * FROM [VAITRO]"></asp:SqlDataSource>

</asp:Content>

